package com.foreknow.mapping;

import com.foreknow.bean.Admin;

import java.sql.ResultSet;
import java.sql.SQLException;

public class AdminMapping implements EntityMapping {
  @Override
  public Object mapping(ResultSet rs) throws SQLException {
    Admin admin = new Admin();
    admin.setId(rs.getInt("ID"));
    admin.setUsername(rs.getString("USERNAME"));
    admin.setPassword(rs.getString("PASSWORD"));
    admin.setAge(rs.getInt("AGE"));
    admin.setSchool(rs.getString("SCHOOL"));
    return admin;
  }
}
